package com.kehao.newcoder;

import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Stack;

public class NC90Solution {

    PriorityQueue<Integer> queue = new PriorityQueue<>();
    Stack<Integer> stack = new Stack<>();


    public void push(int node) {
        stack.push(node);
        queue.add(node);
    }

    public void pop() {
        Integer pop = stack.pop();
        queue.remove(pop);
    }

    public int top() {
        return stack.peek();
    }

    public int min() {
        return queue.peek();
    }
}
